//
//  ReaderConfig.h
//  ebook
//
//  Created by 吴超飞 on 16/3/13.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MTRotatingScreen.h"

#define Landscape [MTRotatingScreen isOrientationLandscape]

#define TopSpace (iPhoneX?24:0)
#define BottomSpace (iPhoneX ? (Landscape?21:32):0)
#define LeftSpace ((iPhoneX && Landscape)?44:0)
#define RightSpace ((iPhoneX && Landscape)?44:0)

@interface ReaderConfig : NSObject<NSCoding>

/**看书背景颜色
 */
typedef enum{
    Yangpizhi_color,
    Yanhui_Color,
    Huyanlv_Color,
    Shushi_Color,
    Menghuan_Color,
    Night_Color
}ReadBackgroud;

//翻页方式
typedef enum{
    PageTurnStyle_Simulat,
    PageTurnStyle_Interlink,
    PageTurnStyle_Updown,
    PageTurnStyle_NoAni
} PageTurnStyle;

//行间距倍数
typedef enum{
    LINE_SPACE1 = 4,
    LINE_SPACE2 = 3,
    LINE_SPACE3 = 2,
    LINE_SPACE4 = 1
}LineSpace;

//预读章节，下载类型
typedef enum {
    Download_10 = 10,
    Download_100 = 100,
    Download_500 = 500,
    Download_1000 = 1000,
    Download_nowToEnd = 100000,
    Download_all = 999999,//全本压缩包下载
    Download_5 = 5
}DownloadType;

@property (nonatomic,assign) BOOL IsNight;
@property (nonatomic,assign) CGFloat FontSize;
@property (nonatomic,assign) LineSpace LineSpace;
@property (nonatomic,  copy) NSString *fontFullname;//兰亭黑
@property (nonatomic,assign) ReadBackgroud BgColorType;
@property (nonatomic,assign) PageTurnStyle PageTurnStyle;
@property (nonatomic,assign) DownloadType DownloadType;
@property (nonatomic,assign) ReadBackgroud BeforeBgColorType;//前一个设置，主要记录转为夜间模式之前的颜色值

//以下三个值根据pageTurnStyle生成
@property (nonatomic,assign) UIPageViewControllerTransitionStyle PageTransitionStyle;
@property (nonatomic,assign) UIPageViewControllerNavigationOrientation PageNavigationOrientation;
@property (nonatomic,assign) BOOL IsPageTransitionNoAnimate;//是否无动画切换

@property (nonatomic,  copy) NSString *postScript;  //fzlth.ttf
@property (nonatomic,  copy) NSString *fontName;    //FZLanTingHei-R-GBK

//以下三个颜色值根据bgColorType生成
@property (nonatomic,retain) UIColor *ViewBgColor;
@property (nonatomic,retain) UIColor *TitleTextColor;
@property (nonatomic,retain) UIColor *ContentTextColor;

//横屏、竖屏
@property (nonatomic, assign) BOOL orientationIsLandscape;

//自动阅读速度, 取值范围：1-10
@property (nonatomic, assign) NSInteger autoReadingSpeed;
//语音阅读速度，取值范围：1-5
@property (nonatomic,assign) NSInteger phoneticReadingSpeed;
//iPad支持横屏
@property (nonatomic,assign) BOOL ipadIsSupportLandscape;
@property (nonatomic, retain) UIImage *simuBackgroudImage;//仿真翻页背景图
@property (nonatomic, retain) UIImage *batteryImage;//电池电量图标因为每次都需要重绘，保存内存中重用

@property (nonatomic,assign) int padingLeft;
@property (nonatomic,assign) int padingRight;
@property (nonatomic,assign) int padingTop;
@property (nonatomic,assign) int padingBottom;
@property (nonatomic,assign) int padingTop_Updown;
@property (nonatomic,assign) int padingBottom_Updown;

//判断颜色值是否相等，因为double数据精度的问题，只比较四位相等即判断为同一颜色
-(BOOL)isColor:(UIColor *)color1 equalColor:(UIColor *)color2;

@end
